﻿<html>

	<head>
		<title>用户反馈管理</title>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">

		<link href="../../css/skin/default/style.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" href="../../css/dialog.css">
		<link href="../../js/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />

		<script src="../../js/lib/jquery/jquery-1.10.2.min.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>

		<script src="../../js/lib/ligerUI/js/plugins/ligerPopupEdit.js"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerForm.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerRadio.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTree.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerDrag.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerResizable.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerTip.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerMenu.js" type="text/javascript"></script>
		<script src="../../js/lib/ligerUI/js/plugins/ligerToolBar.js" type="text/javascript"></script>
		<script src="../../JS/XHD.js" type="text/javascript"></script>
		<script src="../../js/lib/jquery.form.js" type="text/javascript"></script>
		<script src="../../js/lib/json2.js" type="text/javascript"></script>
		<script src="../../js/dialog.js"></script>
		<script src="../../js/JS/layout.js"></script>
		<script src="../../js/constants.js" type="text/javascript"></script>
		<script src="../../js/api.js" type="text/javascript"></script>

		<script type="text/javascript">
			var manager;
			$(document).hover(parent.hindMenu);
			var mid = $api.getparastr("mid");
			var url = BaseUrl + "feedback/";
			$(function() {
						$("form").ligerForm();
						toolbar();
						let lurl = url + "sql?token=" + $api.getStorage("token") + "&Fstatus=0&Fkey=&Fsdt=" + $("#sdt").val() + "&Fedt=" + $("#edt").val();
						manager = $("#maingrid4").ligerGrid({
								columns: [{
										display: '编号',
										name: 'Fid',
										width: 60
									},
									{
										display: '客户',
										name: 'FloginName',
										width: 100,
										align: 'left'
									},
									{
										display: '所属上级',
										name: 'Fpname',
										width: 100,
										align: 'left'
									}, {
										display: '状态',
										name: 'Fstatus',
										width: 100,
										isSort: true,
										render: function(rowdata, rowindex, value) {
											if(rowdata.Fstatus == 1) return '待回复';
											return '已回复';
										}
									},
									{
										display: '反馈信息',
										name: 'Fmessage',
										minWidth: 300,
										align: 'left'
									},
									{
										display: '提交时间',
										name: 'Fdate',
										type: 'date',
										width: 120
									},
									{
										display: '回复人',
										name: 'Fusername',
										minWidth: 300,
										align: 'left'
									},
									{
										display: '回复时间',
										name: 'Frespdate',
										type: 'date',
										width: 120
									}
								],
								method: 'get',
								dataAction: 'local',
								url: lurl,
								width: '99.5%',
								height: '85%',
								pageSize: 50,
								usePager: true,
								onDblClickRow: function(row, rowindex, rowobj) {
							 		if(row.Fstatus == 1)
										parent.f_openWin('vsys/tb_feedback/Add.html?data=' + escape(JSON.stringify(row)),
											"反馈详情", 480, 270,
											function(res) {
												let lurl = url + "resp?token=" + $api.getStorage("token")
												$api.ajax2(url, res.data, function(data) {
													f_reload();
												});
											});
									else {
										parent.f_openWin2('vsys/tb_feedback/Add.html?data=' + escape(JSON.stringify(row)),
											"反馈详情", 480, 270,
											function(res) {});
									}
								});
						});
					//新增与保存
					function saveInfo(row, cmd) {
						if(cmd == 'feedback') {
							let lurl = url + "resp?token=" + $api.getStorage("token")
							$api.ajax2(url, row.data, function(data) {
								f_reload();
							});
						}

					}
					var sdtManger, edtManager;

					function toolbar() {

						$api.getLimit(mid, 0,
							function(data) {
								$("#icon-list").append(data);
							});
						sdtManger = $("#sdt").ligerGetDateEditorManager({
							absolute: false,
							format: "yyyy-MM-dd"
						});
						edtManager = $("#edt").ligerGetDateEditorManager({
							absolute: false,
							format: "yyyy-MM-dd"
						});

						var dataUtil = new datetool();

						var dateEnd = dataUtil.getNowFormatDate(0);  
						var dateStart = dataUtil.getNowFormatDate(24 * 60 * 60 * 1000 * 30);

						  
						$("#sdt").val(dateStart);  
						$("#edt").val(dateEnd);
					}

					function f_reload() {
						var manager = $("#maingrid4").ligerGetGridManager();
						manager.loadData(true);
					};

					function edit() {
						var manager = $("#maingrid4").ligerGetGridManager();
						var row = manager.getSelectedRow();
						if(row) {
							if(row.Fstatus == 1)
								parent.f_openWin('vsys/tb_feedback/Add.html?data=' + escape(JSON.stringify(row)),
									"反馈详情", 480, 270,
									function(res) {
										let lurl = url + "resp?token=" + $api.getStorage("token")
										$api.ajax2(url, res.data, function(data) {
											f_reload();
										});
									});
							else {
								parent.f_openWin2('vsys/tb_feedback/Add.html?data=' + escape(JSON.stringify(row)),
									"反馈详情", 480, 270,
									function(res) {});
							}
						} else {
							$.ligerDialog.warn("请选择行");
						}
					}

					function doSearch() {
						var lurl = url + "sql?token=" + $api.getStorage("token") +
							"&Fstatus=" + $("#Fstatus").val() +
							"&Fkey=" + $("#Fkey").val() +
							"&Fsdt=" + $("#sdt").val() +
							"&Fedt=" + $("#edt").val();

						manager.GetDataByURL(lurl);
					}
		</script>

	</head>

	<body class="mainbody">
		<form id="form1" onsubmit="return false">
			<div>
				<div class="toolbar-wrap">
					<div class="toolbar">
						<div class="l-list">
							<ul id="icon-list" class="icon-list">
							</ul>
						</div>
					</div>
					<div class="div-content">
						<dl>
							<dt style="width: 60px;">时间区间</dt>
							<dd style="margin-left: 70px;">
								<div style="float:left"> <input type="text" id="sdt" name="sdt" ltype="date" ligerui="{width:120}" />
								</div>
								<div style="float:left;margin: 0 10px;"> 至 </div>
								<div style="float:left">
									<input type="text" id="edt" name="edt" ltype="date" ligerui="{width:120}" /></div>

							</dd>
							<dt style="width: 60px;">状态</dt>
							<dd style="margin-left: 70px;">
								<div style="margin-left: 10px;float:left;">
									<select name="Fstatus" id="Fstatus" ltype="select" ligerui="{width:120}">
										<option value="0" selected="selected">全部</option>
										<option value="1">待回复</option>
										<option value="2">已回复</option>
									</select>

								</div>

							</dd>
							<dt style="width: 60px;">关键词</dt>
							<dd style="margin-left: 70px;">

								<div style="float:left;margin-left: 10px;">
									<input style="display:inline" type="button" value="搜索" class="btn" onclick="doSearch();" />
								</div>

							</dd>
						</dl>

					</div>
				</div>

			</div>
			<div id="maingrid4" style="margin:-1px;background:#fff;"></div>
			</div>
		</form>
	</body>

</html>